'''

@author: wyndem
@Emil:   wyndem@qq.com
@FileName: novel_factory.py
@Time: 2018/11/8 14:58
@Software: PyCharm
@Description: 

'''
from novel.config.rules import RULES, CHAPTER_RULES
from novel.utils.tool import TOOL


def factory_novel(url) -> str:
     cmd=RULES.get(TOOL.get_host_url(url))%url
     return cmd



def factory_chapter(url) -> str:
    return factory(url,CHAPTER_RULES)

def factory(url,rules):
    fuc = rules.get(TOOL.get_host_url(url))
    # if fuc != None:
        # html=Aio([url],None).send()
        # html = requests.get(url, headers=t.getHeaders()).text
        # return fuc(html, url)
    raise RuntimeError('not found target object')


